<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="PhotoController.*,java.util.*, java.io.*,java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="STYLESHEET" type="text/css" href="/KOMORIUTA/css/photo.css">
<link rel="STYLESHEET" type="text/css" href="/KOMORIUTA/page/page.css">
<script>
function com_cancle(a,b,c){
	
	location.href="/KOMORIUTA/PhotoFreeAction.do?action=pt_free_com_cancle&com_id="+a+"&id="+b+"&nick="+c;
}
</script>
<link rel="stylesheet" type="text/css" href="/KOMORIUTA/Mypage/Css/MpBord.css"> 
</head>
<%
PhotoFreeBean photoFreeBean=(PhotoFreeBean)request.getAttribute("photoFreeBean");
ArrayList<PhotoCommentBean> datas=(ArrayList<PhotoCommentBean>)request.getAttribute("list");
String nick=(String)session.getAttribute("Mem_Nick");
%>
<body>
<table cellpadding="0" cellspacing="0" width="700" style="border: 1px solid #bebebe">
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="700">
				<tr>
					<td width="10">&nbsp;</td>
					<td width="680" height="36" colspan="2"  style="border-bottom: 1px dashed #e6e6e6;"><table cellpadding="0" cellspacing="0" width="100%" ><tr><td valign="middle"><b><%= photoFreeBean.getPo_Title() %></b></td></tr></table></td>
					<td width="10">&nbsp;</td>
				</tr>
				
				<tr height="30" valign="middle">
					<td width="10">&nbsp;</td>
					<td><img src="/KOMORIUTA/photo/img/Cm_Free_Read_1.png" style="vertical-align: bottom;">	<%= photoFreeBean.getPo_Nick() %></td>
					<td align="right"><img src="/KOMORIUTA/photo/img/Cm_Free_Read_2.png" style="vertical-align: bottom;"><%= photoFreeBean.getPo_Date() %>
					<img src="/KOMORIUTA/photo/img/Cm_Free_Read_3.png" style="vertical-align: bottom;"><%= photoFreeBean.getPo_Viewcount() %>&nbsp;
					<img src="/KOMORIUTA/photo/img/Cm_Free_Read_4.png" style="vertical-align: bottom;"><%= photoFreeBean.getPo_recom() %></td>
					<td width="10">&nbsp;</td>
				</tr>
				
				<tr><td colspan="4">&nbsp;</td></tr>
				<tr>
					<td width="10">&nbsp;</td>
					<td colspan="2">
						<%= photoFreeBean.getPo_Contents() %>
					</td>
					<td width="10">&nbsp;</td>
				</tr>
			</table>
			
			
			
			<form action="PhotoFreeAction.do" method="post" name="po_comment2">
			<input type="hidden" name="action" value="pt_free_comment" />
			<input type="hidden" name="photozon_id" value="<%= photoFreeBean.getID() %>" />
			<input type="hidden" name="photocom_nick" value="<%= nick %>" />
			<input type="hidden" name="nick" value="<%= nick %>" />
			<%
				if(photoFreeBean.getPo_Nick().equals(nick)){
			
				}else{
			%>
			<table width="700" cellpadding="0" cellspacing="0">
				<%
				for(PhotoCommentBean photoCommentBean : datas){
				%>
				
				
				<tr>
					<td width="10"></td>
					<td colspan="1" height="26" style="font-family:Consolas; font-size: 16px;">
						<%= photoCommentBean.getPhotocom_nick() %>  
						<%
						String photocom_nick=(String)photoCommentBean.getPhotocom_nick();
						String nick2=(String)session.getAttribute("Mem_Nick");
						if(photocom_nick.equals(nick2)){
						%>
						<input type="hidden" name="id" value="<%= photoCommentBean.getId() %>" />
						
					
					</td>
					<td colspan="2" valign="bottom" style="color: #7c7c7c; font-size: 10px; vertical-align: middle; "><%= photoCommentBean.getPhotocom_date() %><input type="button" class="btn_x" value="" onClick="com_cancle('<%= photoCommentBean.getId()%>','<%=photoFreeBean.getID() %>','<%=nick %>')" /></td>
					<td width="10" colspan="2"></td>
				</tr>
				<tr>
					<td width="10"></td>
					<td width="10"></td>
					<td><%= photoCommentBean.getPhotocom_contents() %></td>
					<td width="10"></td>
					<td width="10"></td>
				</tr>
				
				<tr>
				<td width="10"></td>
				<td colspan="3" height="10" style="border-bottom: 1px dashed #bebebe"></td>
				<td width="10"></td>
				</tr>
				<%
					}	}
				%>
				<tr height="10"><td colspan="5"></td></tr>
				<tr>
					<td colspan="5" align="center" valign="bottom">
						<textarea cols="60" rows="3" name="photocom_contents"  >
						</textarea>
						<input type="submit" value="" class="btn_tukeru" style="vertical-align: top;"/>
					</td>
				</tr>
				<tr height="10"><td colspan="5"></td></tr>
			</table>	
			<%
			}
			%>
		</form>	
	</td>
	</tr>
</table>	
<table align="center" cellpadding="0" cellspacing="0">
	<tr height="10"><td colspan="5"></td></tr>
	<tr>
		<td><a href="/KOMORIUTA/PhotoFreeAction.do?action=pt_free_list2&nick=<%=nick %>"><img src="/KOMORIUTA/photo/img/Mybold_List.png" style="vertical-align: bottom;"></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<%
			
			if(photoFreeBean.getPo_Nick().equals(nick)){
		%>
		<td>
		
		<a href="/KOMORIUTA/PhotoFreeAction.do?action=pt_free_modify_form&id=<%=photoFreeBean.getID() %>&nick=<%= nick %>">
		
		<img src="/KOMORIUTA/photo/img/syusei.jpg" border=0 />
		
		</a>
		</td>
		<td><a href="/KOMORIUTA/PhotoFreeAction.do?action=pt_free_delete&id=<%=photoFreeBean.getID() %>&nick=<%=nick %>"><img src="/KOMORIUTA/photo/img/torikesi2.jpg" border=0 /></a></td>
		<% 
			}
		%>
		<%
			
			if(photoFreeBean.getPo_Nick().equals(nick)){
		%>
		<td></td>
		<%
			}else{
		%>
		<td><a href="/KOMORIUTA/PhotoFreeAction.do?action=pt_free_recom&id=<%=photoFreeBean.getID() %>&nick=<%=nick %>"><img src="/KOMORIUTA/photo/img/Mybold_Per.png" style="vertical-align: middle;"></a></td>
		<%
			}
		%>
	</tr>
	<tr height="10"><td colspan="5"></td></tr>
</table>	

</body>
</html>